import saleOutDepotDetail from "../../api/sale-out-depot-detail";
let sodDetail = {
    data(){
        return{
            tableData: [],
            titleData:[],//数据信息
            sodId: this.$route.query.sodId
        }
    },
    methods:{
        /**
         * 查询所有
         */
        async searchPage() {
            let titleData = await saleOutDepotDetail.fideTitle(this.sodId);
            this.titleData = titleData;

            let tableData = await saleOutDepotDetail.findTable(this.sodId);

            let snList = await saleOutDepotDetail.getSn(this.sodId);
            for (let i=0;i<snList.length;i++){
                if (tableData[i].goodsId === snList[i].gdId){
                    tableData[i].gdSns = snList[i].gdSnList.join('  ');
                    tableData[i].gfSn = snList[i].gfSn;
                }
            }

            this.tableData = tableData;
        },

    },
    created(){
        this.searchPage();
    }
};

export default sodDetail;